{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "直观理解高斯核函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "x=np.arange(-4,5,1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-4, -3, -2, -1,  0,  1,  2,  3,  4])"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "y=np.array((x>=-2)&(x<=2),dtype='int')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 0, 1, 1, 1, 1, 1, 0, 0])"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjcAAAGdCAYAAADuR1K7AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAAhgUlEQVR4nO3dfVCVdf7/8dcBBTI9h1DkREKa66aupbMYiDWTBRNWU7FpmeMmGWOrg66G6yplsTc1dLNt5k1a7azWqqNrrVqua7lY2nckb0A372drLG8I0FzOIVqB4Pz+cDz9WNHAzuFw3j0fM2caLj7XOZ/3modnF+ecdfh8Pp8AAACMiAj1BgAAAAKJuAEAAKYQ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rU1FRUUj3Qdy00ezZs+VwOC56O3TokObPn6+amhoVFBSEestt0tr5zpk5c6Z2796t9957T5GRkRo/frx8HfxDr9s6oySdOHFCI0eO1H333aeJEyeGaOetcynzAR1JXl6e9u3bp5UrV4Z6KwF37bXXas+ePdq+fbsmT56snJwcHThwINTbCohjx45p2rRpWr58uWJiYkK6F/7vF9ro5MmT+vLLLy+65pprrtH999+vd955Rw6Hw3+8sbFRkZGRGjdunF5//fVgb/WStHa+qKio844fP35cSUlJ2rZtW4e+zNrWGcvLyzVixAgNGzZMS5cuVUREx/5vgkv5M1y6dKmmT5+u6urqIO8uOOrr69WlSxe9+eabys7O9h/PyclRdXW1uSuKDodDa9asaTarFVOmTNG6deu0detW9enTJ9TbCbrMzEz17dtXr7zySqi38r2tXbtWP/vZzxQZGek/1tjYKIfDoYiICNXV1TX7XjB1apdHMSQ+Pl7x8fHfuW7evHl66qmn/F+Xl5crKytLq1atUlpaWjC3+L20dr6WNDU1STr71veOrC0znjhxQrfccotSUlK0ZMmSDh820vf7MwxXUVFRSklJUXFxsf8HflNTk4qLizVlypTQbg6t4vP5NHXqVK1Zs0YffPDBDyJspLP/nnb058zWysjI0N69e5sdmzBhgvr3769Zs2a1W9hIxE3QJCcnN/u6a9eukqS+ffuqV69eodhSQG3fvl07d+7UTTfdpCuuuEKffvqpnnjiCfXt27dDX7VpixMnTmjEiBG6+uqr9Yc//EEnT570f8/tdodwZ4Fz9OhRnT59WkePHlVjY6P/c5h+9KMf+f+dDRf5+fnKycnR0KFDlZqaqrlz56q2tlYTJkwI9dYC4quvvtInn3zi//rIkSPas2eP4uLiznu+CUd5eXlasWKF1q1bp27duvlfK+VyuXTZZZeFeHeBUVBQoNtvv13JycmqqanRihUr9MEHH+jdd98N9dYColu3bue9RurcazLb/bVT7f7+rB+oI0eOmHor+Mcff+y75ZZbfHFxcb7o6Ghf7969fZMmTfIdP3481FsLmCVLlvgktXizIicnp8X53n///VBv7ZLMnz/fl5yc7IuKivKlpqb6Pvroo1BvKWDef//9Fv+scnJyQr21gLjQ37UlS5aEemsB8/DDD/uuvvpqX1RUlC8+Pt6XkZHhe++990K9raAK1VvBec0NAAAwpeO/gAAAAKANiBsAAGAKcQMAAEwhbgAAgCnEDQAAMIW4AQAAphA3AADAFOIGAACYQtwAAABTiBsAAGAKcQMAAEwhbgAAgCn/D8JMj30Q7m5SAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\"\"\"模拟一维数据,线性不可分的情况\"\"\"\n",
    "plt.scatter(x[y==0],[0]*len(x[y==0]))\n",
    "plt.scatter(x[y==1],[0]*len(x[y==1]))\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "#高斯核函数（模拟）\n",
    "def Gaussian(x,l):\n",
    "    gamma=1.0\n",
    "    return np.exp(-gamma*(x-l)**2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "l1,l2=-1,1\n",
    "#计算二维数据\n",
    "X_new=np.empty((len(x),2))#x长度的行，2列\n",
    "for index,data in enumerate(x):\n",
    "    X_new[index,0]=Gaussian(data,l1)\n",
    "    X_new[index,1]=Gaussian(data,l2)\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAiMAAAGdCAYAAADAAnMpAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAAhUklEQVR4nO3df3BU5aH/8U82kA0MbMCbZvPDLRGsIoJQg6QBuZZOahy8ofzRMQUvoYw/qqJjybRC5EdElCAqQytRxqjF3qsF9YpD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fZzbFwI+zkuTmAFAAD914A+MgIAAOwjRgAAgFXECAAAsIoYAQAAVvX7GKmoqFB2draSk5OVm5urXbt2dTn/5Zdf1tixY5WcnKwJEyaoqqoqRiuNb072c2VlpaZPn66RI0dq5MiRys/PP+//F3zL6XP6G5s3b1ZCQoJmz57dtwvsJ5zu588//1wLFy5URkaG3G63LrvsMv796Aan+3n9+vW6/PLLNWTIEPl8Pi1atEhfffVVjFYbn959910VFhYqMzNTCQkJeu211867zY4dO3T11VfL7Xbr0ksv1aZNm/p2kaYf27x5s0lKSjLPPfec+cc//mFuu+02M2LECBMIBDqc//7775vExESzdu1as3fvXrNs2TIzePBg8+GHH8Z45fHF6X6eO3euqaioMHv27DH79u0zv/71r01KSor55z//GeOVxx+n+/obhw8fNllZWWb69OnmF7/4RWwWG8ec7ufW1lYzefJkM3PmTPPee++Zw4cPmx07dpj6+voYrzy+ON3PL7zwgnG73eaFF14whw8fNm+88YbJyMgwixYtivHK40tVVZVZunSpefXVV40ks3Xr1i7nHzp0yAwdOtSUlJSYvXv3mieeeMIkJiaa6urqPltjv46RKVOmmIULF0a+DoVCJjMz05SXl3c4/6abbjI33nhj1Fhubq75zW9+06frjHdO9/N3nT171gwfPtw8//zzfbXEfqMn+/rs2bNm6tSp5plnnjHz588nRrrB6X5+6qmnzOjRo01bW1usltgvON3PCxcuND/72c+ixkpKSsy0adP6dJ39SXdi5L777jNXXnll1FhRUZEpKCjos3X127dp2traVFdXp/z8/MiYy+VSfn6+amtrO9ymtrY2ar4kFRQUdDofPdvP33X69GmdOXNGF110UV8ts1/o6b5+8MEHlZaWpltuuSUWy4x7PdnP27ZtU15enhYuXCiv16vx48dr9erVCoVCsVp23OnJfp46darq6uoib+UcOnRIVVVVmjlzZkzWPFDYeC2Miz+U1xONjY0KhULyer1R416vV/v37+9wG7/f3+F8v9/fZ+uMdz3Zz9+1ePFiZWZmnvPkR7Se7Ov33ntPzz77rOrr62Owwv6hJ/v50KFDevvtt3XzzTerqqpKBw8e1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8wDDzxgxowZY5KTk43P5zN33XWX+de//hX7hceRd955p8N/c7/Zt/PnzzfXXXfdOdtMmjTJJCUlmdGjR5s//elPfbrGBGM4tgUAAOzpt+eMAACA+ECMAAAAq4gRAABgFTECAACsIkYAAIBVxAgAALCKGAEAAFYRIwAAwCpiBAAAWEWMAAAAq4gRAABgFTECAACs+v8kRyshYeRZeAAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\"\"\"一维数据映射成二维数据\"\"\"\n",
    "plt.scatter(X_new[y==0,0],X_new[y==0,1])\n",
    "plt.scatter(X_new[y==1,0],X_new[y==1,1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
